using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using System.Drawing.Drawing2D;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;

using PickGold.Charting.ChartTypes;
using PickGold.Charting.Design;

namespace PickGold.Charting
{

	[DefaultProperty("Enabled")]
	[SRDescription("DescriptionAttributeLabel_Label")]
	[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
	[AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
	public class LabelStyle : ChartElement
	{
		private Axis _Axis;
		private bool _Enabled;
		private Font _Font;
		private FontCache _FontCache;
		private Color _ForeColor;
		private string _Format;
		private bool _IsEndLabelVisible;
		private bool _TruncatedLabels;

		internal int _Angle;
		internal double _Interval;
		internal double _IntervalOffset;
		internal DateTimeIntervalType _IntervalOffsetType;
		internal DateTimeIntervalType _IntervalType;
		internal bool _IsStaggered;

		public LabelStyle()
		{
			this._Enabled = true;
			this._IntervalOffset = double.NaN;
			this._Interval = double.NaN;
			this._IntervalType = DateTimeIntervalType.NotSet;
			this._IntervalOffsetType = DateTimeIntervalType.NotSet;
			this._FontCache = new FontCache();
			this._ForeColor = Color.Black;
			this._IsEndLabelVisible = true;
			this._Format = "";
			this._Font = this._FontCache.DefaultFont;
		}

		internal LabelStyle(Axis axis) : this()
		{
			this._Axis = axis;
		}

		protected override void Dispose(bool disposing)
		{
			if (disposing && (this._FontCache != null))
			{
				this._FontCache.Dispose();
				this._FontCache = null;
			}
		}

		private RectangleF GetAllLabelsRect(ChartArea area, AxisPosition position, StringFormat stringFormat)
		{
			Axis axis = null;
			foreach (Axis axis2 in area.Axes)
			{
				if (axis2.AxisPosition == position)
				{
					axis = axis2;
					break;
				}
			}
			if (axis == null)
			{
				return RectangleF.Empty;
			}
			RectangleF ef = area.Position.ToRectangleF();
			if (position == AxisPosition.Left)
			{
				ef.Width = axis.labelSize;
				if (axis.GetIsMarksNextToAxis())
				{
					ef.X = (float)axis.GetAxisPosition();
					ef.Width = Math.Max(ef.Width, ef.X - axis.PlotAreaPosition.X);
				}
				else
				{
					ef.X = axis.PlotAreaPosition.X;
				}
				ef.X -= ef.Width;
				if (area.IsSideSceneWallOnLeft() || (area.Area3DStyle.WallWidth == 0))
				{
					ef.X -= axis.markSize;
				}
				stringFormat.Alignment = StringAlignment.Far;
				stringFormat.LineAlignment = StringAlignment.Center;
				return ef;
			}
			if (position == AxisPosition.Right)
			{
				ef.Width = axis.labelSize;
				if (axis.GetIsMarksNextToAxis())
				{
					ef.X = (float)axis.GetAxisPosition();
					ef.Width = Math.Max(ef.Width, axis.PlotAreaPosition.Right - ef.X);
				}
				else
				{
					ef.X = axis.PlotAreaPosition.Right;
				}
				if (!area.IsSideSceneWallOnLeft() || (area.Area3DStyle.WallWidth == 0))
				{
					ef.X += axis.markSize;
				}
				stringFormat.Alignment = StringAlignment.Near;
				stringFormat.LineAlignment = StringAlignment.Center;
				return ef;
			}
			if (position == AxisPosition.Top)
			{
				ef.Height = axis.labelSize;
				if (axis.GetIsMarksNextToAxis())
				{
					ef.Y = (float)axis.GetAxisPosition();
					ef.Height = Math.Max(ef.Height, ef.Y - axis.PlotAreaPosition.Y);
				}
				else
				{
					ef.Y = axis.PlotAreaPosition.Y;
				}
				ef.Y -= ef.Height;
				if (area.Area3DStyle.WallWidth == 0)
				{
					ef.Y -= axis.markSize;
				}
				stringFormat.Alignment = StringAlignment.Center;
				stringFormat.LineAlignment = StringAlignment.Far;
				return ef;
			}
			if (position == AxisPosition.Bottom)
			{
				ef.Height = axis.labelSize;
				if (axis.GetIsMarksNextToAxis())
				{
					ef.Y = (float)axis.GetAxisPosition();
					ef.Height = Math.Max(ef.Height, axis.PlotAreaPosition.Bottom - ef.Y);
				}
				else
				{
					ef.Y = axis.PlotAreaPosition.Bottom;
				}
				ef.Y += axis.markSize;
				stringFormat.Alignment = StringAlignment.Center;
				stringFormat.LineAlignment = StringAlignment.Near;
			}
			return ef;
		}

		internal double GetInterval()
		{
			if (double.IsNaN(this._Interval) && (this._Axis != null))
			{
				return this._Axis.Interval;
			}
			return this._Interval;
		}

		internal double GetIntervalOffset()
		{
			if (double.IsNaN(this._IntervalOffset) && (this._Axis != null))
			{
				return this._Axis.IntervalOffset;
			}
			return this._IntervalOffset;
		}

		internal DateTimeIntervalType GetIntervalOffsetType()
		{
			if ((this._IntervalOffsetType == DateTimeIntervalType.NotSet) && (this._Axis != null))
			{
				return this._Axis.IntervalOffsetType;
			}
			return this._IntervalOffsetType;
		}

		internal DateTimeIntervalType GetIntervalType()
		{
			if ((this._IntervalType == DateTimeIntervalType.NotSet) && (this._Axis != null))
			{
				return this._Axis.IntervalType;
			}
			return this._IntervalType;
		}

		internal static RectangleF GetLabelPosition(PointF position, SizeF size, StringFormat format)
		{
			RectangleF empty = RectangleF.Empty;
			empty.Width = size.Width;
			empty.Height = size.Height;
			if (format.Alignment == StringAlignment.Far)
			{
				empty.X = position.X - size.Width;
			}
			else if (format.Alignment == StringAlignment.Near)
			{
				empty.X = position.X;
			}
			else if (format.Alignment == StringAlignment.Center)
			{
				empty.X = position.X - (size.Width / 2f);
			}
			if (format.LineAlignment == StringAlignment.Far)
			{
				empty.Y = position.Y - size.Height;
				return empty;
			}
			if (format.LineAlignment == StringAlignment.Near)
			{
				empty.Y = position.Y;
				return empty;
			}
			if (format.LineAlignment == StringAlignment.Center)
			{
				empty.Y = position.Y - (size.Height / 2f);
			}
			return empty;
		}

		private AxisPosition GetLabelsPosition(Axis axis)
		{
			double axisProjectionAngle = axis.GetAxisProjectionAngle();
			if (axis.AxisPosition == AxisPosition.Bottom)
			{
				if (axisProjectionAngle <= -25.0)
				{
					return AxisPosition.Right;
				}
				if (axisProjectionAngle >= 25.0)
				{
					return AxisPosition.Left;
				}
			}
			else if (axis.AxisPosition == AxisPosition.Top)
			{
				if (axisProjectionAngle <= -25.0)
				{
					return AxisPosition.Left;
				}
				if (axisProjectionAngle >= 25.0)
				{
					return AxisPosition.Right;
				}
			}
			return axis.AxisPosition;
		}

		internal override void Invalidate()
		{
			base.Invalidate();
		}

		internal void Paint(ChartGraphics graph, bool backElements)
		{
			using (StringFormat format = new StringFormat())
			{
				format.FormatFlags |= StringFormatFlags.LineLimit;
				format.Trimming = StringTrimming.EllipsisCharacter;
				if (this._Axis.LabelStyle.Enabled && (!double.IsNaN(this._Axis.ViewMinimum) && !double.IsNaN(this._Axis.ViewMaximum)))
				{
					if (this._Axis.ChartArea.Area3DStyle.Enable3D && !this._Axis.ChartArea.chartAreaIsCurcular)
					{
						this.Paint3D(graph, backElements);
					}
					else
					{
						RectangleF ef = this._Axis.ChartArea.Position.ToRectangleF();
						float labelSize = this._Axis.labelSize;
						if (this._Axis.AxisPosition == AxisPosition.Left)
						{
							ef.Width = labelSize;
							if (this._Axis.GetIsMarksNextToAxis())
							{
								ef.X = (float)this._Axis.GetAxisPosition();
							}
							else
							{
								ef.X = this._Axis.PlotAreaPosition.X;
							}
							ef.X -= labelSize + this._Axis.markSize;
							format.Alignment = StringAlignment.Far;
							format.LineAlignment = StringAlignment.Center;
						}
						else if (this._Axis.AxisPosition == AxisPosition.Right)
						{
							ef.Width = labelSize;
							if (this._Axis.GetIsMarksNextToAxis())
							{
								ef.X = (float)this._Axis.GetAxisPosition();
							}
							else
							{
								ef.X = this._Axis.PlotAreaPosition.Right;
							}
							ef.X += this._Axis.markSize;
							format.Alignment = StringAlignment.Near;
							format.LineAlignment = StringAlignment.Center;
						}
						else if (this._Axis.AxisPosition == AxisPosition.Top)
						{
							ef.Height = labelSize;
							if (this._Axis.GetIsMarksNextToAxis())
							{
								ef.Y = (float)this._Axis.GetAxisPosition();
							}
							else
							{
								ef.Y = this._Axis.PlotAreaPosition.Y;
							}
							ef.Y -= labelSize + this._Axis.markSize;
							format.Alignment = StringAlignment.Center;
							format.LineAlignment = StringAlignment.Far;
						}
						else if (this._Axis.AxisPosition == AxisPosition.Bottom)
						{
							ef.Height = labelSize;
							if (this._Axis.GetIsMarksNextToAxis())
							{
								ef.Y = (float)this._Axis.GetAxisPosition();
							}
							else
							{
								ef.Y = this._Axis.PlotAreaPosition.Bottom;
							}
							ef.Y += this._Axis.markSize;
							format.Alignment = StringAlignment.Center;
							format.LineAlignment = StringAlignment.Near;
						}
						RectangleF ef2 = ef;
						if ((ef2 != RectangleF.Empty) && (this._Axis.totlaGroupingLabelsSize > 0f))
						{
							if (this._Axis.AxisPosition == AxisPosition.Left)
							{
								ef2.X += this._Axis.totlaGroupingLabelsSize;
								ef2.Width -= this._Axis.totlaGroupingLabelsSize;
							}
							else if (this._Axis.AxisPosition == AxisPosition.Right)
							{
								ef2.Width -= this._Axis.totlaGroupingLabelsSize;
							}
							else if (this._Axis.AxisPosition == AxisPosition.Top)
							{
								ef2.Y += this._Axis.totlaGroupingLabelsSize;
								ef2.Height -= this._Axis.totlaGroupingLabelsSize;
							}
							else if (this._Axis.AxisPosition == AxisPosition.Bottom)
							{
								ef2.Height -= this._Axis.totlaGroupingLabelsSize;
							}
						}
						bool flag = false;
						bool flag2 = true;
						bool flag3 = true;
						int num2 = 0;
						foreach (CustomLabel label in this._Axis.CustomLabels)
						{
							bool truncatedLeft = false;
							bool truncatedRight = false;
							double fromPosition = label.FromPosition;
							double toPosition = label.ToPosition;
							bool flag6 = false;
							double naN = double.NaN;
							double num6 = double.NaN;
							if (label.RowIndex == 0)
							{
								double axisValue = (label.FromPosition + label.ToPosition) / 2.0;
								decimal viewMinimum = (decimal)this._Axis.ViewMinimum;
								decimal viewMaximum = (decimal)this._Axis.ViewMaximum;
								if (flag)
								{
									if (((flag2 && (((decimal)label.FromPosition) < ((decimal)this._Axis.Minimum))) || (flag3 && (((decimal)label.ToPosition) > ((decimal)this._Axis.Maximum)))) || ((((decimal)label.ToPosition) < viewMinimum) || (((decimal)label.FromPosition) > viewMaximum)))
									{
										continue;
									}
									if ((this._Axis.autoLabelOffset == -1) ? this.IsStaggered : (this._Axis.autoLabelOffset == 1))
									{
										num2 = 0;
										Series series = null;
										if ((this._Axis.axisType == AxisName.X) || (this._Axis.axisType == AxisName.X2))
										{
											List<string> xAxesSeries = this._Axis.ChartArea.GetXAxesSeries((this._Axis.axisType == AxisName.X) ? AxisType.Primary : AxisType.Secondary, this._Axis.SubAxisName);
											if (xAxesSeries.Count > 0)
											{
												series = this._Axis.Common.DataManager.Series[xAxesSeries[0]];
												if ((series != null) && !series.IsXValueIndexed)
												{
													series = null;
												}
											}
										}
										double minimum = this._Axis.Minimum;
										while (minimum < this._Axis.Maximum)
										{
											if (minimum >= axisValue)
											{
												break;
											}
											minimum += ChartHelper.GetIntervalSize(minimum, this._Axis.LabelStyle.GetInterval(), this._Axis.LabelStyle.GetIntervalType(), series, 0.0, DateTimeIntervalType.Number, true);
											num2++;
										}
									}
								}
								else if ((((decimal)axisValue) < viewMinimum) || (((decimal)axisValue) > viewMaximum))
								{
									continue;
								}
								if (this._Axis.ScaleSegments.Count > 0)
								{
									AxisScaleSegment segment = this._Axis.ScaleSegments.FindScaleSegmentForAxisValue(axisValue);
									this._Axis.ScaleSegments.AllowOutOfScaleValues = true;
									this._Axis.ScaleSegments.EnforceSegment(segment);
								}
								if ((((decimal)label.FromPosition) < viewMinimum) && (((decimal)label.ToPosition) > viewMaximum))
								{
									flag6 = true;
									naN = this._Axis.GetLinearPosition(axisValue) - 50.0;
									num6 = naN + 100.0;
								}
							}
							else
							{
								if ((label.ToPosition <= this._Axis.ViewMinimum) || (label.FromPosition >= this._Axis.ViewMaximum))
								{
									continue;
								}
								if (!flag && this._Axis.ScaleView.IsZoomed)
								{
									if (label.FromPosition < this._Axis.ViewMinimum)
									{
										truncatedLeft = true;
										fromPosition = this._Axis.ViewMinimum;
									}
									if (label.ToPosition > this._Axis.ViewMaximum)
									{
										truncatedRight = true;
										toPosition = this._Axis.ViewMaximum;
									}
								}
							}
							RectangleF position = ef;
							if (label.RowIndex == 0)
							{
								if (this._Axis.AxisPosition == AxisPosition.Left)
								{
									position.X = ef.Right - this._Axis.unRotatedLabelSize;
									position.Width = this._Axis.unRotatedLabelSize;
									if ((this._Axis.autoLabelOffset == -1) ? this.IsStaggered : (this._Axis.autoLabelOffset == 1))
									{
										position.Width /= 2f;
										if ((num2 % 2) != 0f)
										{
											position.X += position.Width;
										}
									}
								}
								else if (this._Axis.AxisPosition == AxisPosition.Right)
								{
									position.Width = this._Axis.unRotatedLabelSize;
									if ((this._Axis.autoLabelOffset == -1) ? this.IsStaggered : (this._Axis.autoLabelOffset == 1))
									{
										position.Width /= 2f;
										if ((num2 % 2) != 0f)
										{
											position.X += position.Width;
										}
									}
								}
								else if (this._Axis.AxisPosition == AxisPosition.Top)
								{
									position.Y = ef.Bottom - this._Axis.unRotatedLabelSize;
									position.Height = this._Axis.unRotatedLabelSize;
									if ((this._Axis.autoLabelOffset == -1) ? this.IsStaggered : (this._Axis.autoLabelOffset == 1))
									{
										position.Height /= 2f;
										if ((num2 % 2) != 0f)
										{
											position.Y += position.Height;
										}
									}
								}
								else if (this._Axis.AxisPosition == AxisPosition.Bottom)
								{
									position.Height = this._Axis.unRotatedLabelSize;
									if ((this._Axis.autoLabelOffset == -1) ? this.IsStaggered : (this._Axis.autoLabelOffset == 1))
									{
										position.Height /= 2f;
										if ((num2 % 2) != 0f)
										{
											position.Y += position.Height;
										}
									}
								}
								num2++;
							}
							else
							{
								if (label.RowIndex <= 0)
								{
									throw new InvalidOperationException(SR.ExceptionAxisLabelIndexIsNegative);
								}
								if (this._Axis.AxisPosition == AxisPosition.Left)
								{
									position.X += this._Axis.totlaGroupingLabelsSizeAdjustment;
									for (int i = this._Axis.groupingLabelSizes.Length; i > label.RowIndex; i--)
									{
										position.X += this._Axis.groupingLabelSizes[i - 1];
									}
									position.Width = this._Axis.groupingLabelSizes[label.RowIndex - 1];
								}
								else if (this._Axis.AxisPosition == AxisPosition.Right)
								{
									position.X = (position.Right - this._Axis.totlaGroupingLabelsSize) - this._Axis.totlaGroupingLabelsSizeAdjustment;
									for (int j = 1; j < label.RowIndex; j++)
									{
										position.X += this._Axis.groupingLabelSizes[j - 1];
									}
									position.Width = this._Axis.groupingLabelSizes[label.RowIndex - 1];
								}
								else if (this._Axis.AxisPosition == AxisPosition.Top)
								{
									position.Y += this._Axis.totlaGroupingLabelsSizeAdjustment;
									for (int k = this._Axis.groupingLabelSizes.Length; k > label.RowIndex; k--)
									{
										position.Y += this._Axis.groupingLabelSizes[k - 1];
									}
									position.Height = this._Axis.groupingLabelSizes[label.RowIndex - 1];
								}
								if (this._Axis.AxisPosition == AxisPosition.Bottom)
								{
									position.Y = (position.Bottom - this._Axis.totlaGroupingLabelsSize) - this._Axis.totlaGroupingLabelsSizeAdjustment;
									for (int m = 1; m < label.RowIndex; m++)
									{
										position.Y += this._Axis.groupingLabelSizes[m - 1];
									}
									position.Height = this._Axis.groupingLabelSizes[label.RowIndex - 1];
								}
							}
							double linearPosition = this._Axis.GetLinearPosition(fromPosition);
							double num16 = this._Axis.GetLinearPosition(toPosition);
							if (flag6)
							{
								flag6 = false;
								linearPosition = naN;
								num16 = num6;
							}
							if ((this._Axis.AxisPosition == AxisPosition.Top) || (this._Axis.AxisPosition == AxisPosition.Bottom))
							{
								position.X = (float)Math.Min(linearPosition, num16);
								position.Width = ((float)Math.Max(linearPosition, num16)) - position.X;
								if ((label.RowIndex == 0) && ((this._Axis.autoLabelOffset == -1) ? this.IsStaggered : (this._Axis.autoLabelOffset == 1)))
								{
									position.X -= position.Width / 2f;
									position.Width *= 2f;
								}
							}
							else
							{
								position.Y = (float)Math.Min(linearPosition, num16);
								position.Height = ((float)Math.Max(linearPosition, num16)) - position.Y;
								if ((label.RowIndex == 0) && ((this._Axis.autoLabelOffset == -1) ? this.IsStaggered : (this._Axis.autoLabelOffset == 1)))
								{
									position.Y -= position.Height / 2f;
									position.Height *= 2f;
								}
							}
							using (Brush brush = new SolidBrush(label.ForeColor.IsEmpty ? this._ForeColor : label.ForeColor))
							{
								graph.DrawLabelStringRel(this._Axis, label.RowIndex, label.LabelMark, label.MarkColor, label.Text, label.Image, label.ImageTransparentColor, (this._Axis.autoLabelFont == null) ? this._Font : this._Axis.autoLabelFont, brush, position, format, (this._Axis.autoLabelAngle < -90) ? this.Angle : this._Axis.autoLabelAngle, (!this.TruncatedLabels || (label.RowIndex > 0)) ? RectangleF.Empty : ef2, label, truncatedLeft, truncatedRight);
							}
							this._Axis.ScaleSegments.EnforceSegment(null);
							this._Axis.ScaleSegments.AllowOutOfScaleValues = false;
						}
					}
				}
			}
		}

		internal void Paint3D(ChartGraphics graph, bool backElements)
		{
			using (StringFormat format = new StringFormat())
			{
				bool flag;
				format.Trimming = StringTrimming.EllipsisCharacter;
				SizeF relativeSize = graph.GetRelativeSize(new SizeF(1f, 1f));
				AxisPosition labelsPosition = this.GetLabelsPosition(this._Axis);
				float marksZPosition = this._Axis.GetMarksZPosition(out flag);
				bool flag2 = false;
				if ((this._Axis.AxisPosition == AxisPosition.Top) && !this._Axis.ChartArea.ShouldDrawOnSurface(SurfaceNames.Top, backElements, false))
				{
					flag2 = true;
				}
				if ((this._Axis.AxisPosition == AxisPosition.Left) && !this._Axis.ChartArea.ShouldDrawOnSurface(SurfaceNames.Left, backElements, false))
				{
					flag2 = true;
				}
				if ((this._Axis.AxisPosition == AxisPosition.Right) && !this._Axis.ChartArea.ShouldDrawOnSurface(SurfaceNames.Right, backElements, false))
				{
					flag2 = true;
				}
				if (flag2 && (this._Axis.ChartArea.Area3DStyle.WallWidth > 0))
				{
					if (this._Axis.MajorTickMark.TickMarkStyle == TickMarkStyle.InsideArea)
					{
						marksZPosition -= this._Axis.ChartArea.areaSceneWallWidth.Width;
					}
					else if (this._Axis.MajorTickMark.TickMarkStyle == TickMarkStyle.OutsideArea)
					{
						marksZPosition -= this._Axis.MajorTickMark.Size + this._Axis.ChartArea.areaSceneWallWidth.Width;
					}
					else if (this._Axis.MajorTickMark.TickMarkStyle == TickMarkStyle.AcrossAxis)
					{
						marksZPosition -= (this._Axis.MajorTickMark.Size / 2f) + this._Axis.ChartArea.areaSceneWallWidth.Width;
					}
				}
				bool flag3 = this._Axis.GetIsMarksNextToAxis() && !flag;
				if (backElements != flag3)
				{
					RectangleF ef2 = this.GetAllLabelsRect(this._Axis.ChartArea, this._Axis.AxisPosition, format);
					RectangleF ef3 = ef2;
					if ((ef3 != RectangleF.Empty) && (this._Axis.totlaGroupingLabelsSize > 0f))
					{
						if (this._Axis.AxisPosition == AxisPosition.Left)
						{
							ef3.X += this._Axis.totlaGroupingLabelsSize;
							ef3.Width -= this._Axis.totlaGroupingLabelsSize;
						}
						else if (this._Axis.AxisPosition == AxisPosition.Right)
						{
							ef3.Width -= this._Axis.totlaGroupingLabelsSize;
						}
						else if (this._Axis.AxisPosition == AxisPosition.Top)
						{
							ef3.Y += this._Axis.totlaGroupingLabelsSize;
							ef3.Height -= this._Axis.totlaGroupingLabelsSize;
						}
						else if (this._Axis.AxisPosition == AxisPosition.Bottom)
						{
							ef3.Height -= this._Axis.totlaGroupingLabelsSize;
						}
					}
					float num2 = -1f;
					for (int i = 0; i <= this._Axis.GetGroupLabelLevelCount(); i++)
					{
						int num4 = 0;
						foreach (CustomLabel label in this._Axis.CustomLabels)
						{
							RectangleF ef4;
							Axis axis;
							bool truncatedLeft = false;
							bool truncatedRight = false;
							double fromPosition = label.FromPosition;
							double toPosition = label.ToPosition;
							if (label.RowIndex != i)
							{
								continue;
							}
							if (label.RowIndex == 0)
							{
								double num7 = (label.FromPosition + label.ToPosition) / 2.0;
								if ((((decimal)num7) >= ((decimal)this._Axis.ViewMinimum)) && (((decimal)num7) <= ((decimal)this._Axis.ViewMaximum)))
								{
									goto Label_041A;
								}
								continue;
							}
							if ((label.ToPosition <= this._Axis.ViewMinimum) || (label.FromPosition >= this._Axis.ViewMaximum))
							{
								continue;
							}
							if (this._Axis.ScaleView.IsZoomed)
							{
								if (label.FromPosition < this._Axis.ViewMinimum)
								{
									truncatedLeft = true;
									fromPosition = this._Axis.ViewMinimum;
								}
								if (label.ToPosition > this._Axis.ViewMaximum)
								{
									truncatedRight = true;
									toPosition = this._Axis.ViewMaximum;
								}
							}
						Label_041A:
							ef4 = ef2;
							if (label.RowIndex == 0)
							{
								if (this._Axis.AxisPosition == AxisPosition.Left)
								{
									if (!this._Axis.GetIsMarksNextToAxis())
									{
										ef4.X = ef2.Right - this._Axis.unRotatedLabelSize;
										ef4.Width = this._Axis.unRotatedLabelSize;
									}
									if ((this._Axis.autoLabelOffset == -1) ? this.IsStaggered : (this._Axis.autoLabelOffset == 1))
									{
										ef4.Width /= 2f;
										if ((num4 % 2) != 0f)
										{
											ef4.X += ef4.Width;
										}
									}
								}
								else if (this._Axis.AxisPosition == AxisPosition.Right)
								{
									if (!this._Axis.GetIsMarksNextToAxis())
									{
										ef4.Width = this._Axis.unRotatedLabelSize;
									}
									if ((this._Axis.autoLabelOffset == -1) ? this.IsStaggered : (this._Axis.autoLabelOffset == 1))
									{
										ef4.Width /= 2f;
										if ((num4 % 2) != 0f)
										{
											ef4.X += ef4.Width;
										}
									}
								}
								else if (this._Axis.AxisPosition == AxisPosition.Top)
								{
									if (!this._Axis.GetIsMarksNextToAxis())
									{
										ef4.Y = ef2.Bottom - this._Axis.unRotatedLabelSize;
										ef4.Height = this._Axis.unRotatedLabelSize;
									}
									if ((this._Axis.autoLabelOffset == -1) ? this.IsStaggered : (this._Axis.autoLabelOffset == 1))
									{
										ef4.Height /= 2f;
										if ((num4 % 2) != 0f)
										{
											ef4.Y += ef4.Height;
										}
									}
								}
								else if (this._Axis.AxisPosition == AxisPosition.Bottom)
								{
									if (!this._Axis.GetIsMarksNextToAxis())
									{
										ef4.Height = this._Axis.unRotatedLabelSize;
									}
									if ((this._Axis.autoLabelOffset == -1) ? this.IsStaggered : (this._Axis.autoLabelOffset == 1))
									{
										ef4.Height /= 2f;
										if ((num4 % 2) != 0f)
										{
											ef4.Y += ef4.Height;
										}
									}
								}
								num4++;
							}
							else
							{
								if (label.RowIndex <= 0)
								{
									throw new InvalidOperationException(SR.ExceptionAxisLabelRowIndexMustBe1Or2);
								}
								if (labelsPosition != this._Axis.AxisPosition)
								{
									continue;
								}
								if (this._Axis.AxisPosition == AxisPosition.Left)
								{
									ef4.X += this._Axis.totlaGroupingLabelsSizeAdjustment;
									for (int j = this._Axis.groupingLabelSizes.Length; j > label.RowIndex; j--)
									{
										ef4.X += this._Axis.groupingLabelSizes[j - 1];
									}
									ef4.Width = this._Axis.groupingLabelSizes[label.RowIndex - 1];
								}
								else if (this._Axis.AxisPosition == AxisPosition.Right)
								{
									ef4.X = (ef4.Right - this._Axis.totlaGroupingLabelsSize) - this._Axis.totlaGroupingLabelsSizeAdjustment;
									for (int k = 1; k < label.RowIndex; k++)
									{
										ef4.X += this._Axis.groupingLabelSizes[k - 1];
									}
									ef4.Width = this._Axis.groupingLabelSizes[label.RowIndex - 1];
								}
								else if (this._Axis.AxisPosition == AxisPosition.Top)
								{
									ef4.Y += this._Axis.totlaGroupingLabelsSizeAdjustment;
									for (int m = this._Axis.groupingLabelSizes.Length; m > label.RowIndex; m--)
									{
										ef4.Y += this._Axis.groupingLabelSizes[m - 1];
									}
									ef4.Height = this._Axis.groupingLabelSizes[label.RowIndex - 1];
								}
								if (this._Axis.AxisPosition == AxisPosition.Bottom)
								{
									ef4.Y = (ef4.Bottom - this._Axis.totlaGroupingLabelsSize) - this._Axis.totlaGroupingLabelsSizeAdjustment;
									for (int n = 1; n < label.RowIndex; n++)
									{
										ef4.Y += this._Axis.groupingLabelSizes[n - 1];
									}
									ef4.Height = this._Axis.groupingLabelSizes[label.RowIndex - 1];
								}
							}
							double linearPosition = this._Axis.GetLinearPosition(fromPosition);
							double num13 = this._Axis.GetLinearPosition(toPosition);
							if ((this._Axis.AxisPosition == AxisPosition.Top) || (this._Axis.AxisPosition == AxisPosition.Bottom))
							{
								ef4.X = (float)Math.Min(linearPosition, num13);
								ef4.Width = ((float)Math.Max(linearPosition, num13)) - ef4.X;
								if (ef4.Width < relativeSize.Width)
								{
									ef4.Width = relativeSize.Width;
								}
								if ((label.RowIndex == 0) && ((this._Axis.autoLabelOffset == -1) ? this.IsStaggered : (this._Axis.autoLabelOffset == 1)))
								{
									ef4.X -= ef4.Width / 2f;
									ef4.Width *= 2f;
								}
							}
							else
							{
								ef4.Y = (float)Math.Min(linearPosition, num13);
								ef4.Height = ((float)Math.Max(linearPosition, num13)) - ef4.Y;
								if (ef4.Height < relativeSize.Height)
								{
									ef4.Height = relativeSize.Height;
								}
								if ((label.RowIndex == 0) && ((this._Axis.autoLabelOffset == -1) ? this.IsStaggered : (this._Axis.autoLabelOffset == 1)))
								{
									ef4.Y -= ef4.Height / 2f;
									ef4.Height *= 2f;
								}
							}
							RectangleF ef5 = new RectangleF(ef4.Location, ef4.Size);
							Point3D[] points = new Point3D[3];
							if (this._Axis.AxisPosition == AxisPosition.Left)
							{
								points[0] = new Point3D(ef4.Right, ef4.Y, marksZPosition);
								points[1] = new Point3D(ef4.Right, ef4.Y + (ef4.Height / 2f), marksZPosition);
								points[2] = new Point3D(ef4.Right, ef4.Bottom, marksZPosition);
								this._Axis.ChartArea.matrix3D.TransformPoints(points);
								ef4.Y = points[0].Y;
								ef4.Height = points[2].Y - ef4.Y;
								ef4.Width = points[1].X - ef4.X;
							}
							else if (this._Axis.AxisPosition == AxisPosition.Right)
							{
								points[0] = new Point3D(ef4.X, ef4.Y, marksZPosition);
								points[1] = new Point3D(ef4.X, ef4.Y + (ef4.Height / 2f), marksZPosition);
								points[2] = new Point3D(ef4.X, ef4.Bottom, marksZPosition);
								this._Axis.ChartArea.matrix3D.TransformPoints(points);
								ef4.Y = points[0].Y;
								ef4.Height = points[2].Y - ef4.Y;
								ef4.Width = ef4.Right - points[1].X;
								ef4.X = points[1].X;
							}
							else if (this._Axis.AxisPosition == AxisPosition.Top)
							{
								points[0] = new Point3D(ef4.X, ef4.Bottom, marksZPosition);
								points[1] = new Point3D(ef4.X + (ef4.Width / 2f), ef4.Bottom, marksZPosition);
								points[2] = new Point3D(ef4.Right, ef4.Bottom, marksZPosition);
								this._Axis.ChartArea.matrix3D.TransformPoints(points);
								switch (labelsPosition)
								{
									case AxisPosition.Top:
										ef4.X = points[0].X;
										ef4.Width = points[2].X - ef4.X;
										ef4.Height = points[1].Y - ef4.Y;
										goto Label_0FEE;

									case AxisPosition.Right:
										{
											RectangleF ef6 = this.GetAllLabelsRect(this._Axis.ChartArea, labelsPosition, format);
											ef4.Y = points[0].Y;
											ef4.Height = points[2].Y - ef4.Y;
											ef4.X = points[1].X;
											ef4.Width = ef6.Right - ef4.X;
											goto Label_0FEE;
										}
									case AxisPosition.Left:
										{
											RectangleF ef7 = this.GetAllLabelsRect(this._Axis.ChartArea, labelsPosition, format);
											ef4.Y = points[2].Y;
											ef4.Height = points[0].Y - ef4.Y;
											ef4.X = ef7.X;
											ef4.Width = points[1].X - ef7.X;
											break;
										}
								}
							}
							else if (this._Axis.AxisPosition == AxisPosition.Bottom)
							{
								points[0] = new Point3D(ef4.X, ef4.Y, marksZPosition);
								points[1] = new Point3D(ef4.X + (ef4.Width / 2f), ef4.Y, marksZPosition);
								points[2] = new Point3D(ef4.Right, ef4.Y, marksZPosition);
								this._Axis.ChartArea.matrix3D.TransformPoints(points);
								switch (labelsPosition)
								{
									case AxisPosition.Bottom:
										ef4.X = points[0].X;
										ef4.Width = points[2].X - ef4.X;
										ef4.Height = ef4.Bottom - points[1].Y;
										ef4.Y = points[1].Y;
										goto Label_0FEE;

									case AxisPosition.Right:
										{
											RectangleF ef8 = this.GetAllLabelsRect(this._Axis.ChartArea, labelsPosition, format);
											ef4.Y = points[2].Y;
											ef4.Height = points[0].Y - ef4.Y;
											ef4.X = points[1].X;
											ef4.Width = ef8.Right - ef4.X;
											if (this._Axis.autoLabelAngle == 0)
											{
												ef4.Y += this._Axis.markSize / 4f;
											}
											break;
										}
									case AxisPosition.Left:
										{
											RectangleF ef9 = this.GetAllLabelsRect(this._Axis.ChartArea, labelsPosition, format);
											ef4.Y = points[0].Y;
											ef4.Height = points[2].Y - ef4.Y;
											ef4.X = ef9.X;
											ef4.Width = points[1].X - ef9.X;
											if (this._Axis.autoLabelAngle == 0)
											{
												ef4.Y += this._Axis.markSize / 4f;
											}
											break;
										}
								}
							}
						Label_0FEE:
							axis = null;
							foreach (Axis axis2 in this._Axis.ChartArea.Axes)
							{
								if (axis2.AxisPosition == labelsPosition)
								{
									axis = axis2;
									break;
								}
							}
							int angle = (this._Axis.autoLabelAngle < -90) ? this.Angle : this._Axis.autoLabelAngle;
							if (labelsPosition != this._Axis.AxisPosition)
							{
								if (((this._Axis.AxisPosition == AxisPosition.Top) || (this._Axis.AxisPosition == AxisPosition.Bottom)) && ((angle == 90) || (angle == -90)))
								{
									angle = 0;
								}
								else if (this._Axis.AxisPosition == AxisPosition.Bottom)
								{
									if ((labelsPosition == AxisPosition.Left) && (angle > 0))
									{
										angle = -angle;
									}
									else if ((labelsPosition == AxisPosition.Right) && (angle < 0))
									{
										angle = -angle;
									}
								}
								else if (this._Axis.AxisPosition == AxisPosition.Top)
								{
									if ((labelsPosition == AxisPosition.Left) && (angle < 0))
									{
										angle = -angle;
									}
									else if ((labelsPosition == AxisPosition.Right) && (angle > 0))
									{
										angle = -angle;
									}
								}
							}
							var formatFlags = format.FormatFlags;
							if (((((label.RowIndex == 0) && (angle == 0)) && ((this._Axis.groupingLabelSizes != null) && (this._Axis.groupingLabelSizes.Length > 0))) && ((this._Axis.AxisPosition == AxisPosition.Bottom) && (labelsPosition == AxisPosition.Bottom))) && !((this._Axis.autoLabelOffset == -1) ? this.IsStaggered : (this._Axis.autoLabelOffset == 1)))
							{
								if (num2 == -1f)
								{
									Point3D[] pointdArray2 = new Point3D[] { new Point3D(ef5.X, (ef5.Bottom - this._Axis.totlaGroupingLabelsSize) - this._Axis.totlaGroupingLabelsSizeAdjustment, marksZPosition) };
									this._Axis.ChartArea.matrix3D.TransformPoints(pointdArray2);
									float num15 = pointdArray2[0].Y - ef4.Y;
									num2 = (num15 > 0f) ? num15 : ef4.Height;
								}
								ef4.Height = num2;
								if ((format.FormatFlags & StringFormatFlags.LineLimit) == 0)
								{
									format.FormatFlags |= StringFormatFlags.LineLimit;
								}
							}
							using (Brush brush = new SolidBrush(label.ForeColor.IsEmpty ? this._ForeColor : label.ForeColor))
							{
								graph.DrawLabelStringRel(axis, label.RowIndex, label.LabelMark, label.MarkColor, label.Text, label.Image, label.ImageTransparentColor, (this._Axis.autoLabelFont == null) ? this._Font : this._Axis.autoLabelFont, brush, ef4, format, angle, (!this.TruncatedLabels || (label.RowIndex > 0)) ? RectangleF.Empty : ef3, label, truncatedLeft, truncatedRight);
							}
							if (format.FormatFlags != formatFlags)
							{
								format.FormatFlags = formatFlags;
							}
						}
					}
				}
			}
		}

		internal void PaintCircular(ChartGraphics graph)
		{
			using (var format = new StringFormat())
			{
				format.FormatFlags |= StringFormatFlags.LineLimit;
				format.Trimming = StringTrimming.EllipsisCharacter;
				if (this._Axis.LabelStyle.Enabled)
				{
					CircularAxisLabelsStyle circularAxisLabelsStyle = this._Axis.ChartArea.GetCircularAxisLabelsStyle();
					ArrayList circularAxisList = this._Axis.ChartArea.GetCircularAxisList();
					int num = 0;
					foreach (CircularChartAreaAxis axis in circularAxisList)
					{
						if (axis.Title.Length > 0)
						{
							PointF point = new PointF(this._Axis.ChartArea.circularCenter.X, this._Axis.ChartArea.PlotAreaPosition.Y);
							point.Y -= this._Axis.markSize + 1f;
							PointF[] pts = new PointF[] { graph.GetAbsolutePoint(point) };
							float axisPosition = axis.AxisPosition;
							ICircularChartType circularChartType = this._Axis.ChartArea.GetCircularChartType();
							if (((circularChartType != null) && circularChartType.XAxisCrossingSupported()) && !double.IsNaN(this._Axis.ChartArea.AxisX.Crossing))
							{
								axisPosition += (float)this._Axis.ChartArea.AxisX.Crossing;
							}
							while (axisPosition < 0f)
							{
								axisPosition = 360f + axisPosition;
							}
							Matrix matrix = new Matrix();
							matrix.RotateAt(axisPosition, graph.GetAbsolutePoint(this._Axis.ChartArea.circularCenter));
							matrix.TransformPoints(pts);
							format.LineAlignment = StringAlignment.Center;
							format.Alignment = StringAlignment.Near;
							if (circularAxisLabelsStyle != CircularAxisLabelsStyle.Radial)
							{
								if ((axisPosition < 5f) || (axisPosition > 355f))
								{
									format.Alignment = StringAlignment.Center;
									format.LineAlignment = StringAlignment.Far;
								}
								if ((axisPosition < 185f) && (axisPosition > 175f))
								{
									format.Alignment = StringAlignment.Center;
									format.LineAlignment = StringAlignment.Near;
								}
								if ((axisPosition > 185f) && (axisPosition < 355f))
								{
									format.Alignment = StringAlignment.Far;
								}
							}
							else if (axisPosition > 180f)
							{
								format.Alignment = StringAlignment.Far;
							}
							float angle = axisPosition;
							if (circularAxisLabelsStyle == CircularAxisLabelsStyle.Radial)
							{
								if (axisPosition > 180f)
								{
									angle += 90f;
								}
								else
								{
									angle -= 90f;
								}
							}
							else if (circularAxisLabelsStyle == CircularAxisLabelsStyle.Circular)
							{
								format.Alignment = StringAlignment.Center;
								format.LineAlignment = StringAlignment.Far;
							}
							Matrix transform = graph.Transform;
							switch (circularAxisLabelsStyle)
							{
								case CircularAxisLabelsStyle.Radial:
								case CircularAxisLabelsStyle.Circular:
									{
										Matrix matrix3 = transform.Clone();
										matrix3.RotateAt(angle, pts[0]);
										graph.Transform = matrix3;
										break;
									}
							}
							Color titleForeColor = this._ForeColor;
							if (!axis.TitleForeColor.IsEmpty)
							{
								titleForeColor = axis.TitleForeColor;
							}
							using (Brush brush = new SolidBrush(titleForeColor))
							{
								graph.DrawString(axis.Title.Replace(@"\n", "\n"), (this._Axis.autoLabelFont == null) ? this._Font : this._Axis.autoLabelFont, brush, pts[0], format);
							}
							if (this._Axis.Common.ProcessModeRegions)
							{
								SizeF size = graph.MeasureString(axis.Title.Replace(@"\n", "\n"), (this._Axis.autoLabelFont == null) ? this._Font : this._Axis.autoLabelFont);
								RectangleF ef2 = GetLabelPosition(pts[0], size, format);
								PointF[] points = new PointF[] { ef2.Location, new PointF(ef2.Right, ef2.Y), new PointF(ef2.Right, ef2.Bottom), new PointF(ef2.X, ef2.Bottom) };
								using (GraphicsPath path = new GraphicsPath())
								{
									path.AddPolygon(points);
									path.CloseAllFigures();
									path.Transform(graph.Transform);
									this._Axis.Common.HotRegionsList.AddHotRegion(path, false, ChartElementType.AxisLabels, axis.Title);
								}
							}
							if ((circularAxisLabelsStyle == CircularAxisLabelsStyle.Radial) || (circularAxisLabelsStyle == CircularAxisLabelsStyle.Circular))
							{
								graph.Transform = transform;
							}
						}
						num++;
					}
				}
			}
		}

		[SRDescription("DescriptionAttributeLabel_FontAngle")]
		[RefreshProperties(RefreshProperties.All)]
		[Bindable(true)]
		[DefaultValue(0)]
		[SRCategory("CategoryAttributeAppearance")]
		[PersistenceMode(PersistenceMode.Attribute)]
		public int Angle
		{
			get
			{
				return this._Angle;
			}
			set
			{
				if ((value < -90) || (value > 90))
					throw new ArgumentOutOfRangeException("value", SR.ExceptionAxisLabelFontAngleInvalid);

				if ((this.IsStaggered && (value != 0)) && ((value != -90) && (value != 90)))
					this.IsStaggered = false;
				if ((this._Axis != null && this._Axis.Common != null) &&
					(this._Axis.Common.Chart != null && !this._Axis.Common.Chart.Serializing))
					this._Axis.IsLabelAutoFit = false;
				this._Angle = value;
				this.Invalidate();
			}
		}

		internal Axis Axis
		{
			set
			{
				this._Axis = value;
			}
		}

		[SRCategory("CategoryAttributeAppearance")]
		[PersistenceMode(PersistenceMode.Attribute)]
		[Bindable(true), DefaultValue(true)]
		[SRDescription("DescriptionAttributeLabel_Enabled")]
		public bool Enabled
		{
			get
			{
				return this._Enabled;
			}
			set
			{
				this._Enabled = value;
				this.Invalidate();
			}
		}

		[PersistenceMode(PersistenceMode.Attribute)]
		[SRDescription("DescriptionAttributeLabel_Font")]
		[DefaultValue(typeof(System.Drawing.Font), "Microsoft Sans Serif, 8pt")]
		[SRCategory("CategoryAttributeAppearance")]
		[Bindable(true)]
		public System.Drawing.Font Font
		{
			get
			{
				return this._Font;
			}
			set
			{
				if (((this._Axis != null) && (this._Axis.Common != null)) && ((this._Axis.Common.Chart != null) && !this._Axis.Common.Chart.Serializing))
				{
					this._Axis.IsLabelAutoFit = false;
				}
				this._Font = value;
				this.Invalidate();
			}
		}

		[SRCategory("CategoryAttributeAppearance")]
		[NotifyParentProperty(true)]
		[Editor(typeof(ChartColorEditor), typeof(UITypeEditor))]
		[PersistenceMode(PersistenceMode.Attribute)]
		[TypeConverter(typeof(ColorConverter))]
		[DefaultValue(typeof(Color), "Black")]
		[SRDescription("DescriptionAttributeFontColor")]
		[Bindable(true)]
		public Color ForeColor
		{
			get
			{
				return this._ForeColor;
			}
			set
			{
				this._ForeColor = value;
				this.Invalidate();
			}
		}

		[SRDescription("DescriptionAttributeLabel_Format")]
		[PersistenceMode(PersistenceMode.Attribute)]
		[Bindable(true)]
		[DefaultValue("")]
		[SRCategory("CategoryAttributeAppearance")]
		public string Format
		{
			get
			{
				return this._Format;
			}
			set
			{
				this._Format = value;
				this.Invalidate();
			}
		}

		[TypeConverter(typeof(AxisElementIntervalValueConverter))]
		[PersistenceMode(PersistenceMode.Attribute)]
		[SRCategory("CategoryAttributeData")]
		[Bindable(true)]
		[DefaultValue(double.NaN)]
		[SRDescription("DescriptionAttributeLabel_Interval")]
		public double Interval
		{
			get
			{
				return this._Interval;
			}
			set
			{
				this._Interval = value;
				if (this._Axis != null)
				{
					this._Axis.tempLabelInterval = this._Interval;
				}
				this.Invalidate();
			}
		}

		[TypeConverter(typeof(AxisElementIntervalValueConverter))]
		[SRDescription("DescriptionAttributeLabel_IntervalOffset")]
		[PersistenceMode(PersistenceMode.Attribute)]
		[RefreshProperties(RefreshProperties.All)]
		[DefaultValue(double.NaN)]
		[Bindable(true)]
		[SRCategory("CategoryAttributeData")]
		public double IntervalOffset
		{
			get
			{
				return this._IntervalOffset;
			}
			set
			{
				this._IntervalOffset = value;
				this.Invalidate();
			}
		}

		[DefaultValue(10)]
		[RefreshProperties(RefreshProperties.All)]
		[SRCategory("CategoryAttributeData")]
		[Bindable(true)]
		[PersistenceMode(PersistenceMode.Attribute)]
		[SRDescription("DescriptionAttributeLabel_IntervalOffsetType")]
		public DateTimeIntervalType IntervalOffsetType
		{
			get
			{
				return this._IntervalOffsetType;
			}
			set
			{
				this._IntervalOffsetType = value;
				this.Invalidate();
			}
		}

		[SRCategory("CategoryAttributeData")]
		[DefaultValue(10)]
		[SRDescription("DescriptionAttributeLabel_IntervalType")]
		[PersistenceMode(PersistenceMode.Attribute)]
		[Bindable(true)]
		[RefreshProperties(RefreshProperties.All)]
		public DateTimeIntervalType IntervalType
		{
			get
			{
				return this._IntervalType;
			}
			set
			{
				this._IntervalType = value;
				if (this._Axis != null)
				{
					this._Axis.tempLabelIntervalType = this._IntervalType;
				}
				this.Invalidate();
			}
		}

		[Bindable(true)]
		[DefaultValue(true)]
		[SRDescription("DescriptionAttributeLabel_ShowEndLabels")]
		[PersistenceMode(PersistenceMode.Attribute)]
		[SRCategory("CategoryAttributeAppearance")]
		public bool IsEndLabelVisible
		{
			get
			{
				return this._IsEndLabelVisible;
			}
			set
			{
				this._IsEndLabelVisible = value;
				this.Invalidate();
			}
		}

		[PersistenceMode(PersistenceMode.Attribute)]
		[SRDescription("DescriptionAttributeLabel_OffsetLabels")]
		[SRCategory("CategoryAttributeAppearance")]
		[RefreshProperties(RefreshProperties.All)]
		[Bindable(true)]
		[DefaultValue(false)]
		public bool IsStaggered
		{
			get
			{
				return this._IsStaggered;
			}
			set
			{
				if (value && (((this.Angle != 0) || (this.Angle != -90)) || (this.Angle != 90)))
				{
					this.Angle = 0;
				}
				if (((this._Axis != null) && (this._Axis.Common != null)) && ((this._Axis.Common.Chart != null) && !this._Axis.Common.Chart.Serializing))
				{
					this._Axis.IsLabelAutoFit = false;
				}
				this._IsStaggered = value;
				this.Invalidate();
			}
		}

		[SRDescription("DescriptionAttributeLabel_TruncatedLabels")]
		[DefaultValue(false)]
		[SRCategory("CategoryAttributeAppearance")]
		[PersistenceMode(PersistenceMode.Attribute)]
		[Bindable(true)]
		public bool TruncatedLabels
		{
			get
			{
				return this._TruncatedLabels;
			}
			set
			{
				this._TruncatedLabels = value;
				this.Invalidate();
			}
		}
	}
}

